package Presentation.action;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.SwingUtilities;

import Presentationlayout.AdminLogin;

/**
 * An action that directs the user back to {@link Search} 
 * when button is clicked.
 * 
 * @author Emma Hägglund
 *
 */

public class AdminLoginReturnAction implements ActionListener {

	private AdminLogin login;

	@Override
	public void actionPerformed(ActionEvent e) {
		Runnable back = new Runnable() {
			public void run() {
				login.returnToSearch();
			}
		};

		SwingUtilities.invokeLater(back);

	}

	public AdminLoginReturnAction(AdminLogin login) {
		this.login = login;
	}
}
